﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace CastingWellEquipmentGUI.View.Pages
{
    /// <summary>
    /// AlarmHistoryQueryPage.xaml 的交互逻辑
    /// </summary>
    public partial class AlarmHistoryQueryPage : Page
    {
        public AlarmHistoryQueryPage()
        {
            InitializeComponent();
        }
        public static AlarmHistoryQueryPage instance;
        public static AlarmHistoryQueryPage Instance
        {
            get
            {
                if (instance == null)
                {
                    Console.WriteLine("new Page1.................");
                    instance = new AlarmHistoryQueryPage();
                }

                return instance;
            }
        }
        private void DataGrid_AutoGeneratingColumn(object sender, DataGridAutoGeneratingColumnEventArgs e)
        {
            if (e.Column.Header.ToString() == "EventTime" ||
            e.Column.Header.ToString() == "Source" ||
            e.Column.Header.ToString() == "ConditionID" ||
            e.Column.Header.ToString() == "AlarmText" ||
            e.Column.Header.ToString() == "AlarmValue" ||
            e.Column.Header.ToString() == "Severity" ||
            e.Column.Header.ToString() == "SubAlarmType" ||
            e.Column.Header.ToString() == "EventAssociationID" ||
            e.Column.Header.ToString() == "Active" ||
            e.Column.Header.ToString() == "RelieveTime" ||
            e.Column.Header.ToString() == "MSC_DateCreated_Start" ||
            e.Column.Header.ToString() == "MSC_DateCreated_End" ||
            e.Column.Header.ToString() == "OrderNo"
           )
            {
                e.Cancel = true;
            }
        }
    }
}
